<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" value="" id="num1">
    <select id="sel">
        <option value="请选择">请选择</option>
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>       
    </select>
    <input type="text" value="" id="num2">
    <input type="button" value="=" id="btn">
    <input type="text" value="" id="num3">
    <script src="lib/jquery-3.3.1.min.js"></script>
    <script>
        var result;
        $("#btn").click(function(){
            var num1 = parseFloat($("#num1").val());
            var num2 = parseFloat($("#num2").val());
            var sel = $("#sel>option:checked").text();
            console.log(num1);
            console.log(num2);
            console.log(sel);
            switch(sel){
                case "请选择":
                alert("请选择运算方式");
                break;
                case "+":
                result = num1 + num2;
                break;
                case "-":
                result = num1 - num2;
                break;
                case "*":
                result = num1 * num2;
                break;
                case "/":
                result = num1 / num2;
                break;
            }
            $("#num3").val(result);
        });
    </script>
</body>
</html>